rulesystem MoC {
    
  rule markRemoved(v: Infom)   { modify { eval { v.effect = Effect::local; v.ct = v.ct | { "removed" };   } } }
  rule markReordered(v: Infom) { modify { eval { v.effect = Effect::local; v.ct = v.ct | { "reordered" }; } } }    
  rule markRenamed(v: Infom)   { modify { eval { v.effect = Effect::local; v.ct = v.ct | { "renamed" };   } } }
  rule markRephrased(v: Infom) { modify { eval { v.effect = Effect::local; v.ct = v.ct | { "rephrased" }; } } }
  
  //@todo subsetOf, for example  {"rephrased", "literal"} subsetOf provider.ct
        
  rule rippleRemoved {
    provider:Infom -:requiredBy-> dependent:Infom;
    if { provider.effect != Effect::implicit && dependent.effect == Effect::none && ("removed" in provider.ct); }
    modify {
      eval {
        dependent.effect = Effect::implicit;
        dependent.ct     = provider.ct;
        dependent.purl   = provider.url;
        dependent.pxp    = provider.xpath;
      }
    }
  }
    
  rule rippleRephrased {
    provider:Infom -d:requiredBy-> dependent:Infom;
    if { dependent.effect == Effect::none && ("rephrased" in provider.ct) && ("literal" in d.via); }
    modify {
      eval {
        dependent.effect = Effect::implicit;
        dependent.ct     = provider.ct;
        dependent.purl   = provider.url;
        dependent.pxp    = provider.xpath;
      }
    }
  }
    
  rule slurp {
    x: Infom;
    negative { if { x.effect == Effect::local || x.effect == Effect::implicit; } }
    replace {}
  }
        
}
